// import layout from '../components/Layout/Layout'

/**
 * Routes that require authorized access
 */
const asyncRoutesChildren = [
  {
    path: '/',
    name: 'home',
    meta: {
      roles: ['admin', 'editor', 'test'],
      title: '主页',
      i18nKey: 'menuItem.home',
      icon: 'home',
      keepAlive: true
    },
    component: () => import('pages/home/home')
  },
  {
    path: '/user',
    name: 'user',
    meta: {
      roles: ['admin', 'editor'],
      title: '用户管理',
      icon: 'manage_accounts',
      keepAlive: true
    },
    component: () => import('pages/system/user.vue')
  },
  {
    path: '*', // This must be placed at the bottom
    redirect: '/NoFound404',
    meta: {
      roles: ['admin', 'test'],
      isHidden: true
    }
  }
]

const asyncRoutes = [
  {
    path: '/',
    name: 'index',
    redirect: '/',
    component: () => import('layouts/MainLayout'),
    children: asyncRoutesChildren
  }
]

export default asyncRoutes

export { asyncRoutesChildren }
